package com.zkw.gro.cloure.demo

/**
 * Created by Administrator on 2016/4/9 0009.
 */
class AccumulaterMain {
    def static foo(n){
        return {n+=it}
    }

    public static void main(String[] args) {
        def accumulator = foo(1)
        assert accumulator(2) == 3
        assert accumulator(1) == 4
    }
}
